(Description of Prior Art: FIGS. 9A to 9C)
In a conventional imaging device, an image processing unit controls a contrast by using a grayscale histogram of an input image in order to correct a bright image and a dark image so that the images become more visible.
FIGS. 9A to 9C explain contrast control in the conventional imaging device.
A grayscale histogram is a frequency graph showing a brightness level (brightness) and an occurrence frequency (frequency) of pixels in an image. As shown in FIG. 9A, a grayscale histogram of a bright image has a shape in which a high brightness value has a high frequency and a peak is biased to a high brightness side.
As shown in FIG. 9B, a grayscale histogram of a dark image has a shape in which a peak is biased to a low bright side.
These images have a small contrast difference and a low visual perception level (difficult to see).
As shown in FIG. 9C, a process of extracting a range of brightness in which the frequency is high and expanding brightness value distribution of the corresponding range (grayscale histogram expansion) is performed on the grayscale histogram in which the brightness value distribution is biased.
Accordingly, a grayscale gradation of an image is expanded and the visual perception is improved. As a result, a corrected image that is easy to see can be generated.
(Outline of Conventional Grayscale Histogram Expansion Process: FIGS. 10A to 10E)
FIGS. 10A to 10E explain an outline of a grayscale histogram expansion process in the conventional imaging device.
As shown in FIGS. 10A to 10E, an image processing unit of the conventional imaging device calculates a grayscale histogram (FIG. 10B) from an inputted original image (FIG. 10A).
Next, an upper limit value and a lower limit value of a brightness are determined in order to extract a range of concentrated brightness (of high frequency) (FIG. 10C).
A histogram is expanded (FIG. 10D) by correcting an entire brightness value such that an upper limit value becomes a maximum brightness value and a lower limit value becomes a minimum brightness value. Accordingly, a corrected image is obtained (FIG. 10E).
In other words, the range of the concentrated brightness value to be extracted needs to be determined in order to expand a grayscale histogram.
A method for automatically calculating an upper and a lower limit value by using an image processor is suggested as a method for correcting an image by calculating an optimal upper limit value and an optimal lower limit value in real time for monitoring purposes.
For example, based on an opinion that it is optimal to set an upper and a lower limit value of the grayscale histogram to the foot of the mountain of the histogram, the foot of the mountain is automatically detected as the upper and the lower limit value.
The expansion of the grayscale histogram may be performed uniformly on the entire image frame or may be performed on the basis of partial images obtained by dividing the frame in a lattice shape. The latter case is suitable for distributed parallel processing.
For installation in an apparatus, the realization in a small logic capacity is required.
(Conventional Method for Calculating Upper and Lower Limit Value: FIGS. 11A to 11D)
FIGS. 11A to 11D explain an example of calculating an upper and a lower limit value of a grayscale histogram in a conventional case.
As for a method for calculating an upper and a lower limit value with a small logic capacity, there is suggested a method using distribution of two consecutive areas in a histogram as shown in FIGS. 11A to 11D.
First, the frequency values of two consecutive (adjacent) areas (classes) from the end of the histogram are obtained (FIG. 11A). In FIG. 11A, the searching is performed at a high brightness side. Two areas (bins) having the same width with an upper limit value candidate Pu′ interposed therebetween are set at the high bright side and the low bright side and the frequency values of the two bins are obtained.
The frequency values of the two areas are compared with a preset threshold value Th.
In the example of FIG. 11A, the frequency values of the two areas are smaller than the threshold value. Therefore, the upper limit value candidate Pu′ is moved by a predetermined amount toward the low bright side in a next image frame and, then, the frequency values of two bins with the upper limit value candidate Pu′ interposed therebetween are compared with the threshold value (FIG. 11B).
When the frequency values of the two bins are greater than or equal to the threshold value (FIG. 11C), the upper limit value candidate Pu′ is moved to the high bright side.
The above processes are repeated. When the frequency value of one of the bins is greater than or equal to the threshold value and the frequency value of the other bin is smaller than the threshold value, the upper limit value candidate Pu′ that is the boundary of the two bins is determined to be the foot of the mountain and determined as an upper limit value Pu (FIG. 11D).
The process of determining whether the frequency value of one of the two areas is greater than or equal to the threshold value and whether the frequency value of the other area is smaller than the threshold value is referred to as a determination process.
The actual frequency graph (histogram) is not as smooth as that shown in FIGS. 11A to 11D. “The frequency of the bin” may not be the frequency itself and may be a value representing the frequency distribution of the bin, e.g., an average value of three areas including the bin and the areas at both sides thereof, a central value thereof or the like. In that case, frequency values of four consecutive areas are calculated to obtain frequency values of two adjacent bins.
Similarly, the determination process is performed by sequentially moving a lower limit value candidate Pl′ from the end of the low bright side of the histogram. When the frequency value of one of the two areas with a lower limit value candidate Pl′ interposed therebetween is greater than or equal to the threshold value and the frequency value of the other area is smaller than the threshold value, the corresponding lower limit value candidate Pl′ is determined as a lower limit value Pl.
However, in a prior art, the bin is moved by a small amount. Therefore, five to ten frames are required to determine an upper and a lower limit value.
This indicates that the image is not corrected quickly. For example, several frames are required until a dark image becomes bright.
(Difference Caused by Shape of Histogram: FIGS. 12A and 12B)
A problem may be caused by a shape of a histogram. FIGS. 12A and 12B explain a difference caused by a shape of a histogram.
As shown in FIG. 12A, the calculation of the upper and the lower limit value using two areas is performed by using the threshold set based on the histogram having a normal shape. Therefore, an optimal upper and an optimal lower limit value may not be determined depending on a shape of a histogram.
For example, in the case of an arrow shape shown in FIG. 12B, the upper limit value Pu is determined far from the foot of the mountain and, thus, it may not be an optimal value.
In other words, the accuracy in determining the upper and the lower limit value is not uniform depending on a shape of a grayscale histogram.
(Related Art)
As for a technique for improving a contrast of an image, there are known Japanese Patent Application Publication No. 2006-500643 “Active visual perception method and device for characterisation and recognition through the analysis of mono/multidimensional parameters in multiclass computing units and histogram processing, dynamic unit recruitment” (HOLDING BEv. S.A) (Patent Document 1) and Japanese Patent Application Publication No. 2013-55552 “Imaging device” (Hitachi Consumer Electronics Co., Ltd.) (Patent Document 2).
Patent Document 1 discloses a processing method and an apparatus for making an image clear by using a grayscale histogram.
Patent Document 2 discloses a technique for correcting a contrast by generating a control parameter for controlling a range and a degree of correction of the contrast depending on a grayscale histogram and changing signals of DC component and AC component of an image based on the control parameter.
Patent Document 1: Japanese Patent Application Publication No. 2006-500643
Patent Document 2: Japanese Patent Application Publication No. 2013-55552
Patent Document 3: Japanese Patent Application Publication No. 2008-104016
Patent Document 4: Japanese Patent No. 4277773
However, as described above, the conventional imaging device and the conventional image processing method are disadvantageous in that long convergence time is required until the upper and the lower limit value are determined because the searching is performed while moving the candidate value by a small amount in determining the upper and the lower limit value of the grayscale histogram. This is a considerable drawback in real-time monitoring.
Further, the conventional imaging device and the conventional image processing method are disadvantageous in that it is not possible to appropriately calculate the upper and the lower limit value depending on a shape of a grayscale histogram and the calculation accuracy is not uniform.
In another method of determining an upper and a lower limit value, e.g. in a method of calculating an upper and a lower limit value by using a ratio of a frequency based on the entire histogram or the like, the processing becomes complicated and the logic capacity is increased. Therefore, such a method is not suitable for an imaging device.
Specifically, in the case of calculating the entire distribution not the frequency of two consecutive bins only in the brightness distribution, it is difficult to keep the entire distribution in a cash memory and a register in a CPU and the access to an external memory is needed. This may lead to an increase in the processing time.
Patent Documents 1 and 2 do not disclose therein a technique for controlling scanning speeds of two adjacent bins in accordance with a shape of a grayscale histogram in searching an upper and a lower limit value and a technique for controlling a scanning start position and/or a threshold value in accordance with a shape of a grayscale histogram.